package webdev.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.webkit.WebView;
import dev.danang.R;

public class InforOverViewFragment extends BaseFragment implements
		OnClickListener {
	public static final String TAG = InforOverViewFragment.class
			.getSimpleName();
	public static final int SHOW_OVERVIEW = 1;
	public static final int SHOW_HISTORY = 2;
	public static final int SHOW_SYMBOL = 3;
	public static InforOverViewFragment newInstance(int typeShow) {
		InforOverViewFragment inforOverViewFragment = new InforOverViewFragment();
		Bundle args = new Bundle();
		args.putInt("TYPE_SHOW", typeShow);
		inforOverViewFragment.setArguments(args);
		
		return inforOverViewFragment;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View layout = inflater
				.inflate(R.layout.infor_overview_dn_frament, null);
		init(layout);
		setValueForMembers();
		setEventForMembers();

		return layout;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @to do: TODO
	 * 
	 * @see webdev.fragment.BaseFragment#init(android.view.View)
	 */
	@SuppressLint("SetJavaScriptEnabled")
	@Override
	protected void init(View layout) {
		// TODO Auto-generated method stub
		WebView mWebView = (WebView) layout.findViewById(R.id.webview);
		mWebView.getSettings().setJavaScriptEnabled(true);
		int type = getArguments().getInt("TYPE_SHOW");
		switch (type) {
		case 1:// over view
			mWebView.loadUrl("file:///android_asset/Tong_quan_ve_Da_Nang.htm");
			break;
		case 2:// history
			mWebView.loadUrl("file:///android_asset/Lich_su_Da_Nang.htm");
			break;
		case 3:// sysbol
			mWebView.loadUrl("file:///android_asset/bieu_tuong_Da_Nang.htm");
			break;

		default:
			break;
		}
		
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @to do: TODO
	 * 
	 * @see webdev.fragment.BaseFragment#setValueForMembers()
	 */
	@Override
	protected void setValueForMembers() {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @to do: TODO
	 * 
	 * @see webdev.fragment.BaseFragment#setEventForMembers()
	 */
	@Override
	protected void setEventForMembers() {
		// TODO Auto-generated method stub
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @to do: TODO
	 * 
	 * @see webdev.fragment.BaseFragment#getUrl()
	 */
	@Override
	protected String getUrl() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @author: Truong.le
	 * 
	 * @to do: TODO
	 * 
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View v) {

	}


}
